<template>
	<view class="container" >
		
		<button type="primary" @click="startRong">IM列表</button>
		<button type="primary" @click="startTalk">IM回话</button>
		<button type="primary" @click="setOnReceiveMessageListener">回复消息监听器</button>
		<button type="primary" @click="getConversationList">消息列表监听器</button>
		
	</view>
</template>

<script>
	import uniLoadMore from '@/components/uni-load-more.vue';
	import { BASE_IMAGE_URL,homeConfig,homeData,upgrade,newsList,userCenter,userinfo,userMenu } from '@/utils/api'
	// // #ifdef APP-PLUS
	// 	const rongIm = uni.requireNativePlugin('GZF-RongIM');
	// // #endif

 export default {
	components: {uniLoadMore},
	data() {
		return {
		};
	},
	onLoad(e) {
	},
	methods: {
		startRong(){
			console.log(rongIm);
			console.log(rongIm.startRong);
			rongIm.startRong();
		},
		startTalk(){
			console.log(rongIm);
			rongIm.startTalk();
		},
		setOnReceiveMessageListener(){
			let callBack = plus.android.implements("com.baobaoloufu.android.yunpay.Tools$CallBack", {
				"success": function(message){
					console.log(JSON.stringify(message));
					uni.showToast({
						title:"ddddd",
						icon: 'none',
						duration:1000
					});
					uni.showModal({
						content: JSON.stringify(message),
						showCancel:false,
						success: (res) => {
							
						}
					})
				},
				"fail": function(){
					
				}
			})
			plus.android.invoke("com.baobaoloufu.android.yunpay.Tools", "setOnReceiveMessageListener", callBack);
		},
		getConversationList(){
			let callBack = plus.android.implements("com.baobaoloufu.android.yunpay.Tools$ListCallBack", {
				"success": function(conversations){
					console.log(JSON.stringify(conversations));
					
					uni.showModal({
						content: JSON.stringify(conversations),
						showCancel:false,
						success: (res) => {
							
						}
					})
				},
				"fail": function(){
					
				}
			})
			plus.android.invoke("com.baobaoloufu.android.yunpay.Tools", "getConversationList", callBack);
		},
	}
};
</script>

<style lang="scss">
	.container {width: 100vw;font-size: 28upx;min-height: 100vh;overflow: hidden;color: #6B8082;position: relative;background-color: #ffffff;}
	
</style>
